home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / PowerMac / SpriteWorld / Examples / SpriteTest / SpriteTest.h < prev    next >
Encoding:
Text File  |  1994-04-25  |  2.5 KB  |  136 lines  |  [TEXT/KAHL]

  1. ///--------------------------------------------------------------------------------------
  2. // SpriteTest.h
  3. //
  4. // Created: 8/14/91 at 1:53 AM
  5. // By: Tony Myles
  6. //
  7. // Copyright © 1991-94 Tony Myles, All rights reserved worldwide.
  8. ///--------------------------------------------------------------------------------------
  9.  
  10.  
  11. #ifndef __SPRITETEST__
  12. #define __SPRITETEST__
  13.  
  14. #ifndef __MENUS__
  15. #include <Menus.h>
  16. #endif
  17.  
  18. #ifndef __SPRITEWORLD__
  19. #include "SpriteWorld.h"
  20. #endif
  21.  
  22. #ifndef __SPRITE__
  23. #include "Sprite.h"
  24. #endif
  25.  
  26.  
  27. enum
  28. {
  29.     kTestCIconID = 128,
  30.     kNumberOfTestSprites = 4,
  31.     kNumberOfTestFrames = 29,
  32.     kTestSpriteMoveTime = 20,
  33.     kTestSpriteFrameTime = 20,
  34.     kBackDropPixPatID = 128,
  35.     kPerformanceAlertID = 200,
  36.     kTestTime = (30 * 60)
  37. };
  38.  
  39. enum
  40. {
  41.     kNumberOfCommands = 9,
  42.     kSpriteTestTitleCommand = 0,
  43.     kBouncingBallsCommand,
  44.     kCollisionDetectionCommand,
  45.     kCopyBitsTestCommand,
  46.     kBlitPixieTestCommand,
  47.     kSpriteTestCommand,
  48.     kCompileSpriteCommand,
  49.     kRunCompiledSpriteCommand,
  50.     kRunSafeCompiledSpriteCommand
  51. };
  52.  
  53.  
  54. typedef struct SpriteTestRec SpriteTestRec;
  55. typedef SpriteTestRec *SpriteTestPtr, **SpriteTestHdl;
  56.  
  57.  
  58. struct SpriteTestRec
  59. {
  60.     SpriteWorldPtr spriteWorldP;
  61.     SpriteLayerPtr spriteLayerP;
  62.     SpritePtr testSpriteArray[kNumberOfTestSprites];
  63.     SpritePtr titleSpriteP;
  64.     FramePtr testFrameP;
  65.     FramePtr titleFrameP;
  66.     Boolean isTestRunning;
  67.     char pad1;
  68.     Boolean isCommandActive[kNumberOfCommands];
  69. };
  70.  
  71.  
  72. OSErr CreateSpriteTest(
  73.     SpriteTestPtr* spriteTestP,
  74.     CWindowPtr srcWindowP);
  75.  
  76. void DisposeSpriteTest(
  77.     SpriteTestPtr spriteTestP);
  78.  
  79. void SetupSpriteTest(
  80.     SpriteTestPtr spriteTestP);
  81.  
  82. void SetupTestSprite(
  83.     SpritePtr testSpriteP,
  84.     Rect *moveBoundsRect,
  85.     short horizLocation,
  86.     short vertLocation);
  87.  
  88. void SWBounceSpriteCollideProc(
  89.     SpritePtr srcSpriteP,
  90.     SpritePtr dstSpriteP,
  91.     Rect* sectRect);
  92.  
  93. void RunSpriteTest(
  94.     SpriteTestPtr spriteTestP);
  95.  
  96. void UpdateSpriteTest(
  97.     SpriteTestPtr spriteTestP);
  98.  
  99. void HandleCreateSpriteCommand(
  100.     SpriteTestPtr spriteTestP);
  101.  
  102. void HandleGetSpriteInfoCommand(
  103.     SpriteTestPtr spriteTestP);
  104.  
  105. void HandleRunPauseCommand(
  106.     SpriteTestPtr spriteTestP);
  107.  
  108. void HandleSpriteTestTitleCommand(
  109.     SpriteTestPtr spriteTestP);
  110.  
  111. void HandleBouncingBallsCommand(
  112.     SpriteTestPtr spriteTestP);
  113.  
  114. void CopyBitsSpeedTestCommand(
  115.     SpriteTestPtr spriteTestP);
  116.  
  117. void BlitPixieSpeedTestCommand(
  118.     SpriteTestPtr spriteTestP);
  119.  
  120. void SpriteTestCommand(
  121.     SpriteTestPtr spriteTestP,
  122.     CWindowPtr srcWindowP);
  123.  
  124. void DisplayPerformance(
  125.     long frames,
  126.     long seconds);
  127.  
  128. void CompileSpriteCommand(
  129.     SpriteTestPtr spriteTestP);
  130.  
  131. void RunCompiledSpriteCommand(
  132.     SpriteTestPtr spriteTestP,
  133.     Boolean useQuickDraw);
  134.  
  135.  
  136. #endif